package com.lineage.server.serverpackets;

import com.lineage.server.templates.L1Rank;
import java.util.Iterator;
import java.util.List;

public class S_PacketBoxGree extends ServerBasePacket {
  private byte[] _byte;
  
  private static final int GREEN_MESSAGE = 84;
  
  private static final int SECRETSTORY_GFX = 83;
  
  public S_PacketBoxGree(String msg) {
    this._byte = null;
    writeC(250);
    writeC(84);
    writeC(2);
    writeS(msg);
  }
  
  public S_PacketBoxGree(int type) {
    this._byte = null;
    writeC(250);
    writeC(83);
    writeD(type);
    writeC(0);
    writeC(0);
    writeC(0);
  }
  
  public S_PacketBoxGree(int type, String msg) {
    this._byte = null;
    writeC(250);
    writeC(84);
    writeC(type);
    writeS(msg);
  }
  
  public S_PacketBoxGree(List<?> totalList, int totalSize, int this_order, int this_score) {
    this._byte = null;
    this._byte = null;
    writeC(250);
    writeC(112);
    writeD(0);
    writeD(totalSize);
    Iterator<?> iterator = totalList.iterator();
    while (iterator.hasNext()) {
      L1Rank rank = (L1Rank)iterator.next();
      writeC(rank.getMemberSize());
      writeD(rank.getScore());
      writeS(rank.getPartyLeader());
      Iterator<String> iterator2 = rank.getPartyMember().iterator();
      while (iterator2.hasNext()) {
        String memberName = iterator2.next();
        writeS(memberName);
      } 
    } 
    writeC(this_order);
    writeD(this_score);
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
